{include file="public/layout" /}
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="admin/admin_bar" /}
    <form class="form-horizontal" id="adminEdit" action="{:U('Admin/admin_edit')}" method="post">
        <input type="hidden" name="admin_id" value="{$info.admin_id}">
        <div class="ncap-form-default">
            <dl class="row none">
                <dt class="tit">
                    <label><em>*</em>所属角色</label>
                </dt>
                <dd class="opt">
                    {eq name="$info.admin_id" value="$Think.session.admin_id"}
                    {$Think.session.admin_info.role_name}
                    {else /}
                    <select name="role_id" id="role_id">
                        {eq name="$Think.session.admin_info.role_id" value="-1"}
                        <option value="-1">超级管理员</option>
                        {/eq}
                        {$select_html}
                    </select>
                    <span class="err"></span>
                    <p class="notic"></p>
                    {/eq}
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="user_name">用户名</label>
                </dt>
                <dd class="opt">
                    {$info.user_name}
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password">登录密码</label>
                </dt>
                <dd class="opt">
                    <input type="password" name="password" value="" id="password" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="true_name">真实姓名</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="true_name" value="{$info.true_name|default=''}" id="true_name" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="mobile">手机号码</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="mobile" value="{$info.mobile}" id="mobile" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="email">Email邮箱</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="email" value="{$info.email}" id="email" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    // 判断输入框是否为空
    function adsubmit(){
        {eq name="$Think.session.admin_info.role_id" value="-1"}
        if($('#role_id').val() == ''){
            layer.msg('请选择所属角色！', {icon: 2,time: 1000});
            return false;
        }
        {/eq}
        layer_loading('正在处理');
        $('#adminEdit').submit();
    }

    // function fun_role_select(obj) {
    //     var role_id = $(obj).val();
    //     var role_name = jQuery.trim($(obj).find("option:selected").text());
    //     if (role_id) {
    //         $(obj).parent().find('p.notic').append('<a onclick="javascript:$(this).remove();" class="ncap-btn"><input type="hidden" name="role_ids[]" value="'+role_id+'"><i class="fa fa-check"></i>'+role_name+'</a>&nbsp;&nbsp;');
    //     }
    // }
</script>

{include file="public/footer" /}